home *** CD-ROM | disk | FTP | other *** search
/ Champak 125 / Vol 125 (Damaged).iso / games / rabbit_r.swf / scripts / __Packages / disney / rabbitRivalry / scroller / Scroller.as next >
Encoding:
Text File  |  2009-06-09  |  1.1 KB  |  47 lines

  1. class disney.rabbitRivalry.scroller.Scroller
  2. {
  3.    var __world;
  4.    var __scrollRate;
  5.    var __panels;
  6.    var loop;
  7.    function Scroller(t_data)
  8.    {
  9.       this.__world = t_data.owner;
  10.       this.__scrollRate = 400;
  11.       this.__panels = [];
  12.    }
  13.    function addPanel(distance, asset)
  14.    {
  15.       this.__panels.push(new disney.rabbitRivalry.scroller.ScrollerPanel(this.__world,distance,asset));
  16.    }
  17.    function addSky(asset)
  18.    {
  19.       this.__panels.push(new disney.rabbitRivalry.scroller.ScrollerSky(this.__world,asset));
  20.    }
  21.    function render(camera, dt)
  22.    {
  23.       this.loop = this.__panels.length;
  24.       while(this.loop--)
  25.       {
  26.          this.__panels[this.loop].render(camera,dt);
  27.       }
  28.    }
  29.    function generate(camera)
  30.    {
  31.       this.loop = this.__panels.length;
  32.       while(this.loop--)
  33.       {
  34.          this.__panels[this.loop].spawn(camera);
  35.       }
  36.    }
  37.    function clear(t_viewport)
  38.    {
  39.       super.onErase(t_viewport);
  40.       this.loop = this.__panels.length;
  41.       while(this.loop--)
  42.       {
  43.          this.__panels[this.loop].clear();
  44.       }
  45.    }
  46. }
  47.